/**  
 * All rights Reserved, Designed By www.tydic.com
 * @Title:  MyJob.java   
 * @Package com.axin.job   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: axin     
 * @date:   2019年3月8日 下午11:32:30   
 * @version V1.0 
 * @Copyright: 2019 www.hao456.top Inc. All rights reserved. 
 */
package com.axin.job;

import org.joda.time.DateTime;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.axin.common.quartz.QuartzManager;
import com.axin.common.websocket.WebSocketServer;
 
@DisallowConcurrentExecution
public class MyJob implements Job{
 
    private Logger logger = LoggerFactory.getLogger(MyJob.class);
 
    //直接注入  
    @Autowired
    private QuartzManager quartzManager;
    
    private static WebSocketServer socketServer = new WebSocketServer();
 
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            task(context);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    public void task(JobExecutionContext context) throws Exception{
    	DateTime dateTime = new DateTime();
    	String string = dateTime.toString("yyyy-MM-dd hh:mm:ss");
    	//socketServer.sendMessageToUser(10000, string+ " --> 执行了一次任务");
    }
 
}